package com.juguo.charginganimation.View.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.TextView;

import com.juguo.charginganimation.R;
import com.juguo.charginganimation.utils.UITools;

public class PrivacyPolicysActivity extends AppCompatActivity {
    private TextView tilite;
    private TextView tvqx;
    private WebView urlWebView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_privacy_policys);
        UITools.makeStatusBarTransparent(this);
        UITools.setMIUI(this, true);
        tilite = findViewById(R.id.tv_title);
        tilite.setText("隐私政策");
        userAgree();
        onclick();
    }
    private void userAgree(){
        urlWebView = (WebView) findViewById(R.id.webView);
        urlWebView.getSettings().setJavaScriptEnabled(true);
        String url = getIntent().getStringExtra("url");
        urlWebView.setWebViewClient(new WebViewClient() {
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                return false;
            }
        });
        urlWebView.loadUrl(url);
    }
    private void onclick() {
        tvqx = findViewById(R.id.tv_qx);
        tvqx.setOnClickListener(v -> finish());
    }
}